Skip to content

fix(platform): port upload_artifact.py to mcp 2.x SDK - #185

Merged
wongk merged 2 commits into
mainfrom
fix/upload-artifact-mcp2
Aug 7, 2026
Merged

fix(platform): port upload_artifact.py to mcp 2.x SDK#185
wongk merged 2 commits into
mainfrom
fix/upload-artifact-mcp2

Conversation

@wongk

@wongk wongk commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

plugins/platform/skills/upload-artifact/scripts/upload_artifact.py fails at connect time against the current MCP Python SDK. The documented invocation uv run --with 'mcp[cli]' is unpinned and now resolves to mcp 2.0.0, where three 1.x-era shapes no longer hold:

Site Script expects mcp 2.0.0
streamable_http_client(...) 3-tuple yield 2-tuple (read_stream, write_stream)
result.isError (x4) camelCase field result.is_error
_build_http_client httpx.AsyncClient transport takes httpx2.AsyncClient (httpx no longer pulled in)

Change

  • Port the script to the 2.x API: httpx2 client, 2-tuple unpack, result.is_error.
  • Pin the invocation to mcp[cli]>=2,<3 in the module docstring and SKILL.md so it cannot drift again.
  • Dedupe the connect boilerplate (previously copied in list_projects and upload) into one _connect async context manager; the get-document error path now reuses _error_details.
  • Dev dependency group mcp==1.27.0 -> 2.0.0 (+ uv lock) so pyright checks against the SDK the script actually requires. Nothing else in the repo imports mcp.
  • platform 1.1.3 -> 1.1.4, CHANGELOG entry.

Verification

Live MCPServer streamable-http test server, script run end to end against it:

  • --list-projects -> project list
  • create + --verify -> round-trip lengths match
  • --artifact-id version + --verify -> round-trip lengths match
  • server-side tool exception -> {"error": "create-document-version failed", "details": [...]}, exit 1
  • missing file -> error, exit 1

uv run ruff check . clean, uv run pyright 0 errors, uv run pytest plugins/ -q 2103 passed / 3 skipped.

wongk added 2 commits August 7, 2026 10:45
httpx2 client, 2-tuple streamable_http_client unpack, result.is_error; pin invocations to mcp[cli]>=2,<3 and dev group to mcp==2.0.0.
@wongk
wongk merged commit b89c372 into main Aug 7, 2026
5 checks passed
@wongk
wongk deleted the fix/upload-artifact-mcp2 branch August 7, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants